﻿using CPPEI.WebApi;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CMS.WebApi
{
    [Module("cms")]
    public class Module : BaseModule
    {
        protected override void OnInitiate()
        {
            CMS.Domain.Cache.UploadMediaDirectory = System.Web.HttpContext.Current.Server.MapPath("~/_content/media/");
            if(!Directory.Exists(CMS.Domain.Cache.UploadMediaDirectory))
            {
                Directory.CreateDirectory(CMS.Domain.Cache.UploadMediaDirectory);
            }

            CMS.Domain.Cache.BaseUrl = System.Configuration.ConfigurationManager.AppSettings["XWeb.App.BaseUrl"];
        }
    }
}
